import java.sql.*;

public class Test4 {
    private static String driver="com.mysql.jdbc.Driver";
    private static String url="jdbc:mysql://localhost:3306/school?useSSL=false";
    private static String user="root";
    private static String password="123456";

    public static void main(String[] args) throws ClassNotFoundException, SQLException {
        Class.forName(driver);
        Connection conn= DriverManager.getConnection(url,user,password);
        String sql="delete from stu where age=19";
        Statement stmt= conn.createStatement();
        int n=stmt.executeUpdate(sql);
        System.out.println("这个操作影响到"+n+"条记录");

        stmt.close();
        conn.close();
    }
}

